Converts a value returned from a LearningStore query to a given type. Throws an exception if the value is DBNull.
Parent Type: LearningStoreHelper
Namespace: Microsoft.SharePointLearningKit
Assembly: Microsoft.SharePointLearningKit.dll
| C# |
|
public static void CastNonNull<T> ( ) where T : struct |
T
The type to convert to.
value
A value from a DataRow within a DataTable returned from a LearningStore query.
result
Where to store the result. value is cast to the type of result, or is set to null if value is DBNull.
This version of Cast is used to retrieve a value type from LearningStore, i.e. bool, DateTime, float, double, Guid, int, or an enumerated type, when you know that the input value will not be the database "NULL" value. (If it is, an exception is thrown.)